<?php
namespace app\admin\model;

use think\Model;

class Takes extends Model
{
	public function getTypeAttr($value){
		$types = array(2=>lang('所有线路'),1=>lang('所有用户'));
		if($value === false){
			return $types;
		}
		return isset($types[$value]) ? $types[$value] : '';
	}
	public function getWeeksAttr($value){
		$weeks = array(0=>lang('周日'),1=>lang('周一'),2=>lang('周二'),3=>lang('周三'),4=>lang('周四'),5=>lang('周五'),6=>lang('周六'));
		if($value === false){
			return $weeks;
		}
		$value = str_replace(array(0,1,2,3,4,5,6),array_values($weeks), $value);
		return $value;
	}
	public function getMonthAttr($value){
		$mons = array(1=>lang('每个月'),3=>lang('每季度'),6=>lang('每半年'),12=>lang('每一年'));
		return $mons[$value];
	}
}